package com.kyivmohyla.kma2.model;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Equipment implements IsSerializable {
    private int equipmentId;
    private String name;
    private int isParent;
    private int parentId;
    private String description;

    public Equipment() {
    }

    public int getEquipmentId() {
        return equipmentId;
    }

    public void setEquipmentId(int equipmentId) {
        this.equipmentId = equipmentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIsParent() {
        return isParent;
    }

    public void setIsParent(int isParent) {
        this.isParent = isParent;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object other) {
        return (other instanceof Equipment) ? equipmentId == ((Equipment) other).equipmentId
                : (other == this);
    }

    @Override
    public int hashCode() {
        return this.getClass().hashCode();
    }

    @Override
    public String toString() {
        return String
                .format("Equipment(equipmentId = %d, name = %s, isParent = %d, parentId = %d, description = %s)",
                        equipmentId, name, isParent, parentId, description);
    }
}